package com.ysd.lis.controller.lab;


import com.ysd.common.Result;
import com.ysd.lis.annotation.LogDetail;
import com.ysd.lis.aspect.OperationType;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.lab.LabItemDictCritical;
import com.ysd.lis.service.lab.LabItemDictCriticalService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 报告项目危急值 前端控制器
 * </p>
 *
 * @author wanghao
 * @since 2024-01-27
 */
@RestController
@RequestMapping("/lab/itemDictCritical")
public class LabItemDictCriticalController extends BaseController {

    @Autowired
    private LabItemDictCriticalService criticalService;

    @ApiOperation("获取危急值信息")
    @GetMapping("/findItemDictCritical")
    public Result findItemDictCritical(LabItemDictCritical labItemDictCritical) {
        return criticalService.findItemDictCritical(labItemDictCritical);
    }

    @ApiOperation("批量新增或修改危急值信息")
    @PostMapping("/saveOrUpdateCritical")
    public Result saveOrUpdateCritical(@RequestBody List<LabItemDictCritical> labItemDictCriticals) {
        return criticalService.saveOrUpdateCritical(labItemDictCriticals);
    }

    @ApiOperation("删除危急值信息")
    @PostMapping("/deleteItemCritical")
    @LogDetail(requestParam = "deleteItemCritical", operationType = OperationType.DELETE, module = "报告项目", businessName = "itemDictName", content = "删除【itemDictName】危急值操作")
    public Result deleteItemCritical(@RequestBody LabItemDictCritical itemDictCritical) {
        return criticalService.deleteItemCritical(itemDictCritical);
    }

}
